Changes to readFrom()

As explained previously, calls to readFrom() that specify the third argument overwrite an initialized instance of a class. Since this is generally a bad thing to do, the third argument to readFrom() has been eliminated; thus, readFrom() will only return a pointer to an object. This form of readFrom() was used to initialize member class instances. These must now be initialized via the readFrom() constructor in the initializer list, as shown in the example. When converting old programs, these calls to readFrom() will be flagged as errors because the three argument form of readFrom() is no longer defined. Note that when you change the readFrom() constructor, you must also change the corresponding storer() function to store the member using storeMemberOn() rather than storeOn().

In previous releases, the second argument to readFrom() was an optional name of the class of object that was expected to be read. If the object read was of a different class, readFrom() raised an error. Beginning with this release, readFrom(OIOin&), and readFrom(OIOifd&) are static member functions of each class which will also accept derived classes of the specified class, just as C++ allows a pointer to a derived class to be used instead of a pointer to a base class. The global functions readFrom(istream, const char* classname) and readFrom(int fd, const char* classname) have been eliminated.